#ifndef PFS_BLOCK_FILE_H
#define PFS_BLOCK_FILE_H
#include <map>
#include <string>
#include <stdint.h>

using namespace std;

namespace PFS
{
    class Block2File
    {
        public:
            Block2File()
            {}
            virtual ~Block2File()
            {
                block_file_map.clear();
            }

            const char* find_map_file(const uint32_t block_id) const;
            void add_map_file(const uint32_t block_id, const char* file_name);
            void remove_map_file(const uint32_t block_id);
            const char* rename_map_file(const uint32_t block_id, const char* new_file_name);
            inline bool exsit(const uint32_t block_id) const
            {
                return block_file_map.count(block_id) != 0;
            }
            inline uint64_t get_block_num() const
            {
                return static_cast<uint64_t>(block_file_map.size());
            }
        private:
            typedef map<uint32_t, string>::iterator ITER;
            Block2File(const Block2File&);
            Block2File& operator=(const Block2File &);
            map<uint32_t, string> block_file_map;
    };
}
#endif
